package com.zxl.mediator;
/**
 * ������н���
 * @author zxl
 * 2016��8��8��
 */
public class ConcreteMediator implements Mediator {
	
	private ConcreteColleague1 colleague1;
	private ConcreteColleague2 colleague2;
	
	
	
	public ConcreteColleague1 getColleague1() {
		return colleague1;
	}



	public void setColleague1(ConcreteColleague1 colleague1) {
		this.colleague1 = colleague1;
	}



	public ConcreteColleague2 getColleague2() {
		return colleague2;
	}



	public void setColleague2(ConcreteColleague2 colleague2) {
		this.colleague2 = colleague2;
	}


	/**
	 * ��д������Ϣ�ķ�������ݶ�������ѡ���жϣ�֪ͨ����
	 */
	@Override
	public void send(String message,Colleague colleague) {
		// TODO Auto-generated method stub
		if(colleague == colleague1){
			colleague2.notify(message);
		}else{
			colleague1.notify(message);
		}
	}

}
